﻿using System;
using Newtonsoft.Json;

namespace MTPAutoBackup;

public class FileInfo
{
    public string Id{ get; set; }
    public string DeviceId{ get; set; }
    public string Name { get; set; }
    public Boolean IsDirectory{ get; set; }
    public ulong Size{ get; set; }
    public string DisplaySize{ get; set; }
    public string LastModified{ get; set; }
    public string CreateDate{ get; set; }
    // public DateTime CreationTime{ get; set; }
    // public string LastModifiedStr{ get; set; }

    public string RemotePath{ get; set; }
    //public string LocalPath{ get; set; }
    public string DirectoryPath { get; set; }
    public ulong Sort { get; set; }
    public Boolean IsLoad { get; set; }
    public string DeleteFlag { get; set; }
    
    public FileInfo()
    {
        // 默认无参构造方法
    }
    
    public FileInfo(string name, bool isDirectory,  string remotePath, string directoryPath)
    {
        // Id = id;
        Name = name;
        IsDirectory = isDirectory;
        // Size = size;
        // DisplaySize = displaySize;
        // LastModified = lastModified;
        // LastModifiedStr = lastModifiedStr;
        RemotePath = remotePath;
        DirectoryPath = directoryPath;
    }
    
    // 重写 ToString 方法
    public override string ToString()
    {
        string jsonString = JsonConvert.SerializeObject(this, Formatting.None);
        return jsonString;
    }
}